<%-- 
    Document   : index
    Created on : 2011-3-22, 21:28:10
    Author     : elkan
--%>
<%@page contentType="text/html" language="java" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>JSP版的完善KindEditor在线编辑器</title>
	<script type="text/javascript" src="kindeditor/kindeditor-min.js" charset="UTF-8"></script>
	<script type="text/javascript">
		KE.show({
			 id : "editor",
		     width : "800px",
		     height : "200px",		    
		     resizeMode : 1,
		     allowFileManager : true,
		     /*图片上传的SERVLET路径*/
		     imageUploadJson : "${pageContext.request.contextPath}/uploadImage.html", 
		     /*图片管理的SERVLET路径*/     
		     fileManagerJson : "${pageContext.request.contextPath}/uploadImgManager.html",
		     /*允许上传的附件类型*/
		     accessoryTypes : "doc|xls|pdf|txt|ppt|rar|zip",
		     /*附件上传的SERVLET路径*/
		     accessoryUploadJson : "${pageContext.request.contextPath}/uploadAccessory.html"
		});
	</script>
  </head>
  
  <body bgcolor="#EEF2FB" style="width: 100%;">
 	<div style="height: auto; text-align: left; padding-left: 24%;">
 		<div>
 			<form action="${pageContext.request.contextPath}/show.jsp" method="post">
		 		<h3>JSP版的完善KindEditor在线编辑器</h3>
		 		<h3>作者：elkan 时间：2011-03-22</h3>
		 		<textarea id="editor" name="editor" rows="" cols="" style="width: 800px; height: 200px; visibility: hidden;">
		 			&lt;img title="美女来耶，嘻嘻" border="0" alt="美女来耶，嘻嘻" src="/JSPKindEditor/uploadImg/20110323/20110323213504_52.jpg" width="240" height="251" /&gt;
		 		</textarea>
		 		<input type="submit" name="submit" value="输出内容" style="cursor: pointer;">
		 	</form>
 		</div>
	 	<div style="width: 600px; height: auto; font-size: 12px; font-family: '宋体'; text-align: left;">
	 		完善记录：<br/><br/>
	 		1.集合了日期、时间和特殊字符插件,采用3.0皮肤；<br/><br/>
	 		2.将图片上传与管理的JSP页面改写成SERVLET，同时去除JSON包；<br/><br/>
	 		3.添加图片压缩功能，对超出的宽高压缩成指定的值；<br/><br/> 		
	 		4.添加上传附件功能；<br/><br/>
	 		5.添加图片、附件按日期文件夹分类管理的功能；<br/><br/>
	 		6.添加上传图片、附件的title属性，缺省为原文件名；<br/><br/>
	 		7.添加上传附件相关的初始属性<br/><br/>
	 		8.修改从word粘贴样式，减少样式。<br/><br/>
	 		在此特别感谢<font color="red" style="font-weight: bold;"> 
	 		<a href="http://www.kindsoft.net/view.php?bbsid=7&postid=759" target="_blank" style="text-decoration: none; color: red;">炫羽</a>   
	 		</font>提供的PHP版附件上传功能. <br/><br/>
	 		<font color="red" style="font-weight: bold;">JSP版的完善KindEditor在线编辑器使用说明：</font><br/><br/>
	 		<font color="blue" style="font-weight: bold;">1.web.xml 的servlet及相关属性设置</font><br/>
	 			&lt;!--&nbsp;图片上传的SERVLET&nbsp;&nbsp;--&gt;<br/>
				&nbsp;&lt;servlet&gt;<br/>
				&nbsp;&nbsp;&lt;servlet-name&gt;UploadImage&lt;/servlet-name&gt;<br/>
				&nbsp;&nbsp;&lt;servlet-class&gt;com.elkan.kindeditor.upload.UploadImage&lt;/servlet-class&gt;<br/>
				&nbsp;&nbsp;&lt;!--&nbsp;上传图片保存的目录&nbsp;--&gt;<br/>
				&nbsp;&nbsp;&lt;init-param&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;param-name&gt;UPLOAD_PATH&lt;/param-name&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;param-value&gt;uploadImg/&lt;/param-value&gt;<br/>
				&nbsp;&nbsp;&lt;/init-param&gt;<br/>
				&nbsp;&nbsp;&lt;!--&nbsp;限制上传图片的大小，单位字节(缺省值为1MB)&nbsp;--&gt;<br/>
				&nbsp;&nbsp;&lt;init-param&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;param-name&gt;MAX_SIZE&lt;/param-name&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;param-value&gt;1024000&lt;/param-value&gt;<br/>
				&nbsp;&nbsp;&lt;/init-param&gt;<br/>
				&nbsp;&nbsp;&lt;init-param&gt;<br/>
				&nbsp;&nbsp;&lt;!--&nbsp;上传图片的类型(缺省值为gif,&nbsp;jpg,&nbsp;jpeg,&nbsp;png,&nbsp;bmp)&nbsp;--&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;param-name&gt;IMAGETYPES&lt;/param-name&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;param-value&gt;jpg,png,bmp,jpeg,gif&lt;/param-value&gt;<br/>
				&nbsp;&nbsp;&lt;/init-param&gt;<br/>
				&nbsp;&nbsp;&lt;!--&nbsp;上传图片的宽度，大于此宽度时图片会被压缩(缺省为不限定)&nbsp;--&gt;<br/>
				&nbsp;&nbsp;&lt;init-param&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;param-name&gt;MAX_WIDTH&lt;/param-name&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;param-value&gt;500&lt;/param-value&gt;<br/>
				&nbsp;&nbsp;&lt;/init-param&gt;<br/>
				&nbsp;&nbsp;&lt;!--&nbsp;上传图片的高度，大于此高度时图片会被压缩(缺省为不限定)&nbsp;--&gt;<br/>
				&nbsp;&nbsp;&lt;init-param&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;param-name&gt;MAX_HEIGHT&lt;/param-name&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;param-value&gt;500&lt;/param-value&gt;<br/>
				&nbsp;&nbsp;&lt;/init-param&gt;<br/>
				&nbsp;&lt;/servlet&gt;<br/>
				&nbsp;&nbsp;&lt;!--&nbsp;图片上传管理的SERVLET&nbsp;&nbsp;--&gt;<br/>
				&nbsp;&lt;servlet&gt;<br/>
				&nbsp;&nbsp;&lt;servlet-name&gt;UploadImageManager&lt;/servlet-name&gt;<br/>
				&nbsp;&nbsp;&lt;servlet-class&gt;com.elkan.kindeditor.upload.UploadImageManager&lt;/servlet-class&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;!--&nbsp;上传图片保存的目录&nbsp;--&gt;<br/>
				&nbsp;&nbsp;&lt;init-param&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;param-name&gt;UPLOAD_PATH&lt;/param-name&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;param-value&gt;uploadImg/&lt;/param-value&gt;<br/>
				&nbsp;&nbsp;&lt;/init-param&gt;<br/>
				&nbsp;&lt;/servlet&gt;<br/>
				&nbsp;&nbsp;&lt;!--&nbsp;附件上传的SERVLET&nbsp;&nbsp;--&gt;<br/>
				&nbsp;&lt;servlet&gt;<br/>
				&nbsp;&nbsp;&lt;servlet-name&gt;UploadAccessory&lt;/servlet-name&gt;<br/>
				&nbsp;&nbsp;&lt;servlet-class&gt;com.elkan.kindeditor.upload.UploadAccessory&lt;/servlet-class&gt;<br/>
				&nbsp;&nbsp;&lt;!--&nbsp;上传附件保存的目录&nbsp;--&gt;<br/>
				&nbsp;&nbsp;&lt;init-param&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;param-name&gt;UPLOAD_PATH&lt;/param-name&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;param-value&gt;uploadAttach/&lt;/param-value&gt;<br/>
				&nbsp;&nbsp;&lt;/init-param&gt;<br/>
				&nbsp;&nbsp;&lt;!--&nbsp;上传附件的大小，单位字节(缺省为1MB)&nbsp;--&gt;<br/>
				&nbsp;&nbsp;&lt;init-param&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;param-name&gt;MAX_SIZE&lt;/param-name&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;param-value&gt;1000000&lt;/param-value&gt;<br/>
				&nbsp;&nbsp;&lt;/init-param&gt;<br/>
				&nbsp;&nbsp;&lt;!--&nbsp;上传文件的类型(缺省为doc,&nbsp;xls,&nbsp;ppt,&nbsp;pdf,&nbsp;txt,&nbsp;rar,&nbsp;zip)&nbsp;--&gt;<br/>
				&nbsp;&nbsp;&lt;init-param&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;param-name&gt;FILETYPES&lt;/param-name&gt;<br/>
				&nbsp;&nbsp;&nbsp;&lt;param-value&gt;doc,xls,ppt,zip,rar,txt&lt;/param-value&gt;<br/>
				&nbsp;&nbsp;&lt;/init-param&gt;<br/>
				&nbsp;&lt;/servlet&gt;<br/><br/>
				<font color="blue" style="font-weight: bold;">2.KE 相关属性设置</font><br/>
				KE.show({<br />
				&nbsp;&nbsp;&nbsp; id : "editor",<br />
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; width : "600px",<br />
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; height : "200px",<br />
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resizeMode : 1,<br />
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; allowFileManager : true,<br />
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*图片上传的SERVLET路径*/<br />
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; imageUploadJson : "${pageContext.request.contextPath}/uploadImage.html", <br />
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*图片管理的SERVLET路径*/&nbsp;&nbsp;&nbsp;&nbsp; <br />
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fileManagerJson : "${pageContext.request.contextPath}/uploadImgManager.html",<br />
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*允许上传的附件类型*/<br />
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; accessoryTypes : "doc|xls|pdf|txt|ppt|rar|zip",<br />
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*附件上传的SERVLET路径*/<br />
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; accessoryUploadJson : "${pageContext.request.contextPath}/uploadAccessory.html"<br />
				&nbsp;&nbsp;});
	 	</div>
 	</div>
  </body>
</html>
